<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'account.label', default: 'Account')}"/>
    <title>渠道：${account.name}</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header transition animated fadeIn">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>贷款管理系统</li>
                    <li><g:link controller="bocAccount" action="index">渠道</g:link></li>
                    <li class="active">
                        <span>${this.account.name}</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                渠道: ${this.account.name}
            </h2>
         </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
            </div>
        </g:if>
        <div class="hpanel hred contact-panel">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" action="channelEdit"
                            id="${this.account?.id}"><i class="fa fa-edit"></i>编辑</g:link>
                </div>
                渠道基本信息
            </div>

            <div class="panel-body">
                <div class="text-muted font-bold m-b-xs ol-md-6">
                    <div class="col-md-12"><h4><a href=>${this.account.name}</a></h4></div>
                </div>
            </div>

            <div class="panel-footer contact-footer">
                <div class="row">
                    <div class="col-md-4 border-right" style="">
                        <div class="contact-stat"><span>渠道编号:</span> <strong>${this.account?.code}</strong>
                        </div>
                    </div>

                    <div class="col-md-4 border-right" style="">
                        <div class="contact-stat"><span>渠道简称:</span> <strong>${this.account?.name}</strong>
                        </div>
                    </div>

                    <div class="col-md-4 " style="">
                        <div class="contact-stat"><span>状态:</span> <strong>${this.account?.active}</strong>
                        </div>
                    </div>


                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hyellow">
            <div class="panel-heading">
                <div class="panel-tools">

                </div>
                所属机构信息
            </div>

            <div class="panel-body no-padding">
              <div class="table-responsive">
                  <table class="table table-striped table-bordered table-hover">
                      <thead>
                      <tr>
                          <g:sortableColumn property="name"
                                            title="${message(code: 'account.name.label', default: '机构名称')}"/>
                          <g:sortableColumn property="code"
                                            title="${message(code: 'account.code.label', default: '机构编号')}"/>
                          <g:sortableColumn property="level"
                                            title="${message(code: 'account.level.label', default: '机构等级')}"/>
                          <g:sortableColumn property="officeAddress"
                                            title="${message(code: 'account.officeAddress.label', default: '地址')}"/>
                          <g:sortableColumn property="active"
                                            title="${message(code: 'account.active.label', default: '状态')}"/>


                      </tr>
                      </thead>
                      <tbody>
                      <g:each in="${this.account?.parent}">
                          <tr>
                              <td><g:link action="show" id="${it.id}" class="firstTd">${it.name}</g:link></td>
                              <td>${it.code}</td>
                              <td>${it.level?.name}</td>
                              <td>${it.officeAddress}</td>
                              <td>${it.active}</td>
                          </tr>
                      </g:each>
                      </tbody>
                  </table>
              </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="bocAccountTeam" action="create"
                            params="[account: this.account.id]"><i class="fa fa-plus"></i>添加</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                用户
            </div>

            <div class="panel-body no-padding">
                <ul class="list-group">
                    <g:each in="${this.accountTeam}">
                        <li class="list-group-item">
                            <div class="pull-right">
                                <g:form controller="bocAccountTeam" action="delete" id="${it.id}" method="DELETE">
                                    <button class="deleteBtn btn btn-danger btn-outline btn-xs" type="button"><i class="fa fa-trash-o"></i> 删除</button>
                                </g:form>
                            </div>
                            ${it?.user?.fullName}
                        </li>
                    </g:each>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>
